package com.ericsson.mhealth.server.config.providers;

import java.net.InetAddress;
import java.net.UnknownHostException;

import com.ericsson.mhealth.gvf.GVFConnectionManager;
import com.ericsson.mhealth.gvf.GVFDefaultConnectionManager;
import com.ericsson.mhealth.gvf.GVFManager;
import com.google.inject.Provider;

public class GVFManagerProvider implements Provider<GVFManager> {

	@Override
	public GVFManager get() {
		InetAddress technicalNodeIP;
		int technicalNodeTCP=10000;
		
		try {
			technicalNodeIP = InetAddress.getAllByName("dxmh1")[0];
			GVFConnectionManager gvfConnectionManager = new GVFDefaultConnectionManager(technicalNodeIP, technicalNodeTCP);
			return GVFManager.newInstance(gvfConnectionManager);
		} catch (UnknownHostException e) {
			e.printStackTrace();
		}
		return null;
	}

}
